public class Solution1154 {
    public int dayOfYear(String date) {
        int year=Integer.parseInt(date.substring(0,4));
        int month=Integer.parseInt(date.substring(5,7));
        int day=Integer.parseInt(date.substring(8,10));
        int[] days=new int[]{31,28,31,30,31,30,31,31,30,31,30,31};
        int ans=0;
        for (int i=0;i<month-1;i++){
            ans=ans+days[i];
        }
        if (year%4==0 && (year%400==0 || year%100!=0) && month>2){
            ans++;
        }
        ans=ans+day;
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1154().dayOfYear("2019-01-09"));
    }
}
